Skip to content

feat(details): wire backend openIssuesCount into RepoStats#511

Merged
rainxchzed merged 5 commits into
mainfrom
feat/details-backend-open-issues-count
May 5, 2026
Merged

feat(details): wire backend openIssuesCount into RepoStats#511
rainxchzed merged 5 commits into
mainfrom
feat/details-backend-open-issues-count

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 4, 2026

Summary

Backend just shipped openIssuesCount on every RepoResponse payload (per docs/client/open-issues-count.md on the backend repo). Wires the field into the client so the open-issues stat on Details no longer depends on direct GitHub enrichment.

Changes

  • BackendRepoResponse — adds openIssuesCount: Int = 0 (default = 0 for back-compat with old server during rollout, per backend doc §6).
  • DetailsRepositoryImpl.getRepoStats — uses backendRepo.openIssuesCount as the primary source. GitHub enrichment call still runs for license (backend hasn't shipped license yet), but the openIssues field no longer falls through it. Stale-cache fallback narrowed to the license field only — openIssues comes straight from the backend response.
  • Inline comments updated to reflect new state.

User-visible impact

  • Anon / signed-out users now see real open-issues count on Details. Previously this was always 0 for anon since Fix rate-limit dialog firing on 200 responses + skip Details enrichment when anon #508 disabled the GitHub enrichment for unauthenticated users to preserve the 60/hr quota.
  • Signed-in users see the same value as before (within 24h staleness on cache-hit; live on /refresh).
  • What's-new bullet appended to 1.8.1 (16.json) across all 13 locales.

Out of scope

  • Tap-to-open issues page (doc §4 recommendation): existing StatItem is non-interactive and stats row UX is consistent across stars/forks/issues. Worth a separate UX pass — not bundling here.
  • Dropping GitHub enrichment entirely: still needed for license. Will land when backend ships license per the existing follow-up in CLAUDE.md.

Test plan

  • Signed-out user opens Details on a repo with known open-issues count (e.g. microsoft/vscode) — count matches GitHub website.
  • Signed-in user opens Details — count matches; no regression vs prior behavior.
  • Backend-down scenario (block api.github-store.org) — direct GitHub fallback path still populates openIssues from /repos/{owner}/{name} response.
  • Cold-cache + GitHub enrichment failure for signed-in user — stale license preserved; openIssues comes from backend.
  • What's-new sheet on 1.8.1 install shows the new bullet in device language.

Summary by CodeRabbit

  • New Features

    • Open-issue counts are now shown to all users (including signed-out), sourced from the backend.
  • Improvements

    • Repository stats now consistently surface backend-provided open-issue counts to avoid stale values when external enrichment is unavailable.
  • Documentation

    • “What’s New” release notes updated across 16 languages to reflect these changes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3f7fe2e6-c912-4177-bd3d-e53f55030828

📥 Commits

Reviewing files that changed from the base of the PR and between c55888e and 7ae253a.

📒 Files selected for processing (1)
  • feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository/DetailsRepositoryImpl.kt

Walkthrough

Backend repo DTO gains an openIssuesCount field; details repository now sources open-issues from the backend, updates license fallback logic and cache key; localized "What's New" JSONs add a bullet noting open-issues are visible to all users via the backend.

Changes

Open Issues Backend Integration

Layer / File(s) Summary
Data Shape
core/data/src/commonMain/kotlin/zed/rainxch/core/data/dto/BackendRepoResponse.kt
Added serialized property openIssuesCount: Int = 0.
Core Implementation
feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository/DetailsRepositoryImpl.kt
Cache key bumped to details:stats:v2:$owner/$repo; RepoStats.openIssues assigned from backendRepo.openIssuesCount; license fallback now uses a computed staleLicense only when GitHub enrichment is null.
Presentation / Release Notes
core/presentation/src/commonMain/composeResources/files/whatsnew/*/16.json
Multilingual IMPROVED sections updated to add a bullet: open-issues count is shown to everyone (including signed-out users) using backend-provided data (no GitHub quota cost).

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant DetailsRepo
    participant Backend
    participant Cache
    participant GitHub
    Client->>DetailsRepo: request getRepoStats(owner, repo)
    DetailsRepo->>Cache: getStale(details:stats:v2:owner/repo)
    DetailsRepo->>Backend: fetch backendRepo (includes openIssuesCount)
    Backend-->>DetailsRepo: backendRepo(openIssuesCount,...)
    alt GitHub enrichment available
        DetailsRepo->>GitHub: fetch enrichment
        GitHub-->>DetailsRepo: githubInfo
    end
    DetailsRepo->>Cache: write updated RepoStats (openIssues from backend, license with stale fallback if needed)
    DetailsRepo-->>Client: RepoStats
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through code with twitchy feet,
Backend counts made issues neat.
Signed-out eyes can share the view,
No GitHub quota to pursue.
Tiny hops, a clearer cue.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: wiring backend openIssuesCount into RepoStats, which is the primary objective of this pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/details-backend-open-issues-count

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@core/presentation/src/commonMain/composeResources/files/whatsnew/16.json`:
- Around line 25-26: Update the second bullet string in the whatsnew entry that
currently reads "Open-issues count now shown to everyone, including signed-out
users — sourced from the backend, no GitHub quota cost." to remove the
definitive "no GitHub quota cost" claim and instead note that backend-sourced
stats may still fall back to GitHub in some cases; change the JSON string to a
toned-down sentence such as indicating the open-issues count is shown to all
users and is sourced from the backend but may still query GitHub on backend
errors or for license enrichment when signed-in.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fb436c93-7a77-4f06-8578-6ce24c20a8b2

📥 Commits

Reviewing files that changed from the base of the PR and between 1294ba2 and 4dfb4de.

📒 Files selected for processing (15)
  • core/data/src/commonMain/kotlin/zed/rainxch/core/data/dto/BackendRepoResponse.kt
  • core/presentation/src/commonMain/composeResources/files/whatsnew/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ar/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/bn/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/es/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/fr/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/hi/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/it/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ja/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ko/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/pl/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/ru/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/tr/16.json
  • core/presentation/src/commonMain/composeResources/files/whatsnew/zh-CN/16.json
  • feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository/DetailsRepositoryImpl.kt

Comment thread core/presentation/src/commonMain/composeResources/files/whatsnew/16.json Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository/DetailsRepositoryImpl.kt`:
- Around line 520-523: The cache key was bumped to
"details:stats:v2:$owner/$repo" in getRepoStats (cacheKey variable) but
refreshRepository still invalidates the old "details:stats:$owner/$repo" key, so
update refreshRepository to delete/invalidate the new v2 key instead; locate
refreshRepository and replace or add invalidation for
"details:stats:v2:$owner/$repo" (matching the cacheKey string used in
getRepoStats) so refresh clears the same cache entry getRepoStats uses.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c0471c7a-8cfb-4927-ad77-d6aa0e94b313

📥 Commits

Reviewing files that changed from the base of the PR and between 4dfb4de and 4c34ad6.

📒 Files selected for processing (1)
  • feature/details/data/src/commonMain/kotlin/zed/rainxch/details/data/repository/DetailsRepositoryImpl.kt

rainxchzed and others added 2 commits May 5, 2026 13:53
…ew/16.json

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@rainxchzed rainxchzed merged commit a902c84 into main May 5, 2026
1 check was pending
@rainxchzed rainxchzed deleted the feat/details-backend-open-issues-count branch May 5, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant